﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SMG.Domain.Model.Program;
using SMG.Domain.Repository;
using SMG.Domain.Repository.Program;

namespace Infrastructure.Repository.EntityFramework.Program
{
    /// <summary>
    /// 节目单仓储实现
    /// </summary>
    public class ProgramBillRepository : EntityFrameworkRepository<ProgramBill>, IProgramBillRepository
    {
        public ProgramBillRepository(IRepositoryContext context) :
            base(context) { }            
        
        /// <summary>
        /// 批量添加节目单
        /// </summary>
        /// <param name="bills"></param>
        public void InsertBatch(List<ProgramBill> bills)
        {
            if (bills != null && bills.Any()) {
                bills.ForEach(bill =>
                {
                    Context.RegisterAdded<ProgramBill>(bill);
                });
            }
        }
    }
}
